<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // while循环
        // 1-100
        // let i = 1;
        // while (i <=100) {
        //     console.log(i);
        //     i++;
        // }
        // console.log('while循环结束');

        // do while循环
        // let j = 100;
        // do {
        //     console.log(j);
        //     j++;
        // } while (j <= 200);

        // console.log('do while循环结束');

        let i = 1;
        while (i <=100) {
            if (i % 2 == 0) {
                console.log(i);
            }
            i++;
        }
        console.log('while循环结束');


        let j =1;
        while (j <=100) {
            if (j % 2 != 0) {
                console.log(j);
            }
            j++;
        }
        console.log('while循环结束');
        
        
    </script>
</body>
</html>